<template>
  <svg class="svg-icon nav-icon" aria-hidden="true">
    <use :xlink:href=" isActive ? iconActiveName : iconDefaultName"></use>
  </svg>
</template>
<script>
export default {
  name: 'EpmSvgIcon',
  props: {
    iconDefaultClass: {
      type: String,
      required: true
    },
    iconActiveClass: {
      type: String,
      required: true
    },
    isActive:{
      type: Boolean,
      required: false,
      default:false,
    }
  },
  computed: {
    iconDefaultName() {
      return `#${this.iconDefaultClass}`
    },
    iconActiveName() {
      return `#${this.iconActiveClass}`
    }
  },
}

</script>

<style>
.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
.nav-icon {
  margin-right:6px;
}
</style>
